Repository navigation
test(studio): the edit bench re-reads a waiting box that Studio remounts after a replay - #8807
Conversation
…nts after a replay A press that waits on a save is drawn by Studio's selection box. Right after the replay clears the wait, Studio can remount that box. The bench then read the box of the detached old node and failed the case with "element has no rendered box". It now reads again when the marker is gone from the page, and still fails when a marker in the page has no box.
Edit accuracy: accurate 273 (base branch 271), smooth 68 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
terencecho
left a comment
There was a problem hiding this comment.
Changes requested at c738e39f.
- P2
packages/studio/tests/e2e/edit-accuracy/case.mjs:716— The pre-presswaitingQuadread can still throw when Studio remounts the waiting box after Puppeteer captures its handle. The controlled Chromium check confirmed that this abortspointerGesturebefore mouse-down. Apply the detached-box handling to this read as well, retaining the error for a connected box with no quad. - P2
packages/studio/tests/e2e/edit-accuracy/case.mjs:752— A box can detach after a successful quad read while its old node still has the waiting attribute. The benchmark then accepts the stale quad. Check connectivity alongside the attribute before accepting the sample, and cover that ordering in the retry test.
All 132 edit-accuracy unit tests and all 15 hosted shards passed. The new detached-before-read regression fails against the parent code. The local fast-keys benchmark completed without a harness exception, but failed its undo-byte check, so it did not independently reproduce the reported end-to-end pass.
— tai (automated review)
…s-remounted-waiting-box
… in the page and waiting The read before the press and the read during the drag now share one reader. A box that left the page gives no quad instead of throwing, and a box that left the page right after a good read no longer adds its stale quad. A waiting box still in the page with no quad still fails the case.
|
Both fixed in The read before the press. A box that detaches right after a good read. The reader now accepts the quad only if the box is still in the page and still waiting, in one check after the read. Test: "does not take the quad of a box that left the page, still marked waiting, after it was read" fails on Undo bytes. I could not reproduce it. On the devbox, the fast-keys case at this head passes
|
terencecho
left a comment
There was a problem hiding this comment.
Re-reviewed the edit-accuracy harness at d5ced7c4. The pre-press and drag paths now share the same waiting-box read. A detached box falls back to the current view, and a successful quad is accepted only while its box is connected and still marked waiting. A connected box with no quad still fails the case.
All 135 edit-accuracy unit tests passed locally. The PR body names the regression test that fails without the fix. The hosted grid was still running at review time.
— tai (automated review)
What
The edit accuracy bench no longer fails a case when Studio remounts the selection box right after a waiting press replays. It reads the box again, as it already does when the replay removes the waiting marker. A waiting box that is still in the page but has no box still fails the case.
Why
seqfastkeys-none-px-r0-root-z100failed every run with a sealed preview ("element has no rendered box"), and passed unsealed. At step 5 (a drag right after seeking to 2 s, while the preview reloads after the keyframe save) the press waits, so Studio marks the selection boxdata-dom-edit-press-waiting="save"and draws it at the pointer. The bench takes a handle to that box, reads the element, then reads the box's quad. AMutationObservertrace in Studio's page during the failing runs:The wait ends first (3908 ms), then Studio takes that box out of the page (3917 ms) and mounts a new one 90 ms later. The bench's quad read landed on the removed node, and
DOM.getContentQuadson a node that is not in the page returns no quads, so the case threw before its existing "the replay took the marker away" check could run. Studio's edit itself is right: with the bench reading again, every gated check of this case passes sealed.Related work
Refs #7846 (the sealed preview switch, whose edit accuracy gate reported this case).
How
case.mjs:markerQuadreads the waiting box's quad and returns null only when that box is no longer in the page; any other failure still throws.measureShownreads again when the quad is null, as it does when the marker attribute is gone.Test plan
fails without the fix:
packages/studio/tests/e2e/edit-accuracy/settle.test.mjs"reads again when Studio took the waiting box out of the page before its box was read" fails on main'scase.mjswithError: element has no rendered box. MakingmarkerQuadalways rethrow fails it again; making it never rethrow fails "still fails when a waiting box in the page has no box".bunx vitest run tests/e2e/edit-accuracy/inpackages/studio: 13 files, 132 of 132, three runs in a row.The bench on the devbox (built CLI,
--filter '^seqfastkeys-none-px-r0-root-z100$'), the preview frame'sself.originlogged in every run (nullsealed):"pass" means every gated check passed. Smoothness, which the gate reports but does not gate, is below its mark in every run of both modes.
Not run: the full grid. The change only alters a run where the waiting box's quad read fails on a box that has left the page, which before ended the case with an error.
No visible change
Changes the edit accuracy bench and its test only.